const response = require('../../utils/response');
const auth = require('../../utils/auth');
const adminService = require('../services/adminService');

class AuthController {
    async refreshToken(ctx){
        if(!ctx.state.admin){
            return response.error(ctx, "登录状态已过期", null, 401)
        }
        const admin = await adminService.getAdminById(ctx.state.admin.id);
        console.log(admin, 'admin')
        response.success(ctx, auth.sing(admin));
    }
}

module.exports = new AuthController();